#ifndef CONFIG_H_INCLUDED
#define CONFIG_H_INCLUDED

/*
* Copyright (c) 2010 Michael Collins
*
* This file is part of TerraFirma.
*
* TerraFirma is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TerraFirma is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with TerraFirma.  If not, see <http://www.gnu.org/licenses/>.
*/

/**
This file just defines some platform specifics
and sets #defines based upon how we want the implementation to run
*/

#if defined(_WIN32) || defined(__WIN32__)
    #define TF_WINDOWS
    #ifndef WIN32_LEAN_AND_MEAN
    #define WIN32_LEAN_AND_MEAN
    #endif

#elif defined(linux) || defined(__linux)
    #define TF_LINUX

#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
    #define TF_MACOS

#elif defined(__FreeBSD__)
    #define TF_FREEBSD

#else
    #error Unsupported OS or OS unknown!

#endif

#ifndef TF_WINDOWS
    //We can assume that if you ain't runnin windows, you are runnin a
    //Posix-compliant box
    #define TF_POSIX
#endif


//Some Dedicated-Listen-Client configs
#if defined(SERVER)
    //Dedicated server only runs network, gamestate, and physics threads
    #define TF_NETWORK
    #define TF_GAMESTATE
    #define TF_PHYSICS
    #define SERVING //Defined if this is a server of some sort

#else
    //Listen servers and clients run everything (but tailored versions)
    #define TF_INPUT
    #define TF_SOUND
    #define TF_GRAPHICS
    #define TF_NETWORK
    #define TF_GAMESTATE
    #define TF_PHYSICS
    #if defined(LISTEN)
        #define SERVING
    #endif

#endif

#endif // CONFIG_H_INCLUDED
